home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Magazin: Amiga-CD 1997 May & June
/
Amiga-CD 1997 #5-6.iso
/
pd-disketten
/
dms-gepackt
/
10_95
/
apd-10-95-2.dms
/
apd-10-95-2.adf
/
ARexx-Kurs
/
Listing2.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-09-12
|
3KB
|
88 lines
/* GadTools3.rexx -- ein ListView-Beispiel */
/* dieses Skript wurde etwas modifiziert */
x = addlib("apig.library",0,-30,0)
call addlib("rexxsupport.library",0,-30,0)
call SET_APIG_GLOBALS()
/* Zeiger auf Workbench-Screen holen */
scr = LOCKPUBSCREEN("Workbench")
scrvinfo = GETVISUALINFO(scr)
scrfont = GETVALUE(scr,40,4,'p')
glistpointer = ALLOCVEC(4,MEMF_CLEAR)
conxgad = CREATECONTEXT(glistpointer)
previousgadget = conxgad; myid = 10
/* Zuerst ein NewGadget erzeugen und initialisieren */
newgadx = MakeNewGadget(scrvinfo,scrfont,65,32,185,120,
,"Das Listview-Gadget",PLACETEXT_ABOVE,myid,null())
/* Dann eine Exec-Liste reservieren und initialisieren */
myexeclist = build_me_a_list()
/* we now create the gadget, a LISTVIEW gadget */
previousgadget = CREATEGADGET(LISTVIEW_KIND,
,previousgadget,newgadx,GTLV_LABELS,myexeclist,
,LAYOUTA_SPACING,1,TAG_DONE,0)
wintitle = "APIG v3.1 GadTools-Listview-Gadget-Beispiel"
winidcmp = CLOSEWINDOW+GADGETUP+GADGETDOWN+MOUSEMOVE+INTUITICKS,
+NEWSIZE
winflags = WINDOWCLOSE+WINDOWDRAG+WINDOWSIZING+WINDOWDEPTH,
+GIMMEZEROZERO+ACTIVATE
portname = "apiggadt3_port"; p = openport(portname)
/* Fenster öffnen, conxgad zeigt auf unsere Gadgets */
w1 = OPENWINDOW(portname,0,30,500,200,0,1,winidcmp,winflags,
,wintitle,scr,0,null(),null(),conxgad)
call GT_REFRESHWINDOW(w1,null()) /* ist nötig! */
rpw1 = GETWINDOWRASTPORT(w1) /* zum Zeichen von Text */
exitme = 0; clicked = -1
do while exitme = 0
x = waitpkt(portname)
do forever
msg = getpkt(portname)
if msg = '0000 0000'x then leave
msgclass = getarg(msg,0)
msgcode = getarg(msg,1)
x = reply(msg,0)
select
when msgclass = CLOSEWINDOW then exitme = 1
when msgclass = NEWSIZE then do
if clicked >= 0 then
call pitext(rpw1,290,50,("Zeile" clicked "gewählt"),
,1,0,JAM2,null())
call GT_REFRESHWINDOW(w1,null()) /* ist nötig! */
end
when msgclass = GADGETUP then do
clicked = msgcode
call cleareol(rpw1,290,50)
call pitext(rpw1,290,50,("Zeile" clicked "gewählt"),
,1,0,JAM2,null())
end
otherwise nop
end
end
end
call CLOSEWINDOW(w1); call UNLOCKPUBSCREEN(null(),scr)
call FREEVISUALINFO(scrvinfo); call FREEGADGETS(conxgad)
call FREETHIS(newgadx); call FREEVEC(glistpointer)
call FREE_EXEC_LIST(myexeclist,,1)
exit
build_me_a_list:
/* our list structure always use ALLOCMEM */
/* so it can be freed properly. */
mylist = ALLOCMEM(14,MEMF_CLEAR)
call NEWLIST(mylist)
do x = 1 to 30
txt = "Dies ist Zeile " x-1
ptr_to_node_added = ADD_LIST_NODE(mylist,txt)
end
return mylist